<import file="block/common.html" name="url" :tpl_cfg="['urlName'=>$title,'backList'=>'返回列表']"/>
<div class="layui-fluid">
    <div class="layui-form">
        <div class="layui-form-item">
            <label class="layui-form-label required">应用分类</label>
            <div class="layui-input-inline">
                <input type="text" name="name" lay-verify="required" lay-reqtext="应用分类名称不能为空" placeholder="请输入应用分类名称"
                    value="<{$info['name']??''}>" class="layui-input">
            </div>
        </div>
       
        <div class="layui-form-item">
            <div class="layui-input-block">
                <input type="hidden" name="id" value="<{$info['id']??''}>">
                <button class="layui-btn" lay-submit lay-filter="saveBtn"><i class="layui-icon">&#x1005;</i><?php echo lang('save');?></button>
            </div>
        </div>
    </div>
</div>
<script>
    layui.define(function () {
        var form = layui.form,layer = layui.layer,$ = layui.$;

        form.render();

        //监听提交
        form.on('submit(saveBtn)', function (data) {
            $.post('<{CAUrl("applink",ROUTE["act"])}>', data.field, function (res) {
                if (res.status == 1) {
                    layer.msg(res.info, { icon: 1, time: 1000 }, function () {
                        loadMain('<{CAUrl("applink","cateindex")}>');
                    });
                } else {
                    layer.msg(res.info, { icon: 2, anim: 6, time: 5000 });
                }
            });
            return false;
        });

    });
</script>